﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
//using DbHelper;
using O_D_EvaluationBLL;
using O_D_EvaluationModel;

namespace O_D_Evaluation
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btn_log_Click(object sender, EventArgs e)
        {

        }

        protected void btn_login_Click(object sender, EventArgs e)
        {
            string UserName = Convert.ToString(txtUserName.Text);
            string Password = Convert.ToString(txtPassword.Text);

            UserInfo userInfo = new UserInfo();
            userInfo.UserName = UserName;
            userInfo.Password = Password;

            //UserInfoManager userInfoManager = new UserInfoManager();
            userInfo = UserInfoManager.GetUserInfo(userInfo);

            if (userInfo.UserId != null)
            {
                Response.Write("登录成功" + "<br/>");
                Response.Write("欢迎您," + userInfo.TrueName);
            }
            else
            {
                Response.Write("登录失败");
                Response.Write("<script> alert('用户名或密码错误');</script>");
            }
        }
    }
}